#!/usr/bin/perl
use strict;

# Short script to put in .gnome2/nautilus_scripts .. will let you create
# a new wallpaper by right clicking on an image.  Handy.

my $path = $ENV{'NAUTILUS_SCRIPT_CURRENT_URI'};
my $photo = $ARGV[0];

# strip out nautilus crud
$path =~ s/\s/\\ /g;
$photo =~ s/\s/\\ /g;
$path =~ s/file\:\/\///g;

# Run our wallpaper script!  (fix path)
system( "/home/cpm/bin/perl/wallpaper --photo $path/$photo" );
